package com.moyq5.mvc.framework.dao;

import java.io.Serializable;
import java.util.List;

import org.springframework.transaction.annotation.Transactional;

import com.moyq5.mvc.framework.general.Page;
import com.moyq5.mvc.framework.general.Paging;
import com.moyq5.mvc.framework.general.Sort;
import com.moyq5.mvc.framework.general.Sorting;

/**
 * @author Moyq5
 * @date 2018年8月8日
 * @param <T>
 */
@Transactional
public interface Service<T, S extends T> {
	
	public long count(S entity4s);

	public long count(S entity4s, String searchWord);
	
	public T one(Serializable id);
	
	public T one(S entity4s);
	
	public T one(S entity4s, String searchWord);
	
	public T one(S entity4s, List<Sort> sorts);
	
	public T one(S entity4s, Sorting si);
	
	public List<T> list(S entity4s);
	
	public List<T> list(S entity4s, String searchWord);
	
	public List<T> list(S entity4s, List<Sort> sorts);
	
	public List<T> list(S entity4s, Sorting si);
	
	public Page<T> page(S entity4s);
	
	public Page<T> page(S entity4s, String searchWord);
	
	public Page<T> page(S entity4s, List<Sort> sorts);
	
	public Page<T> page(S entity4s, Sorting si);
	
	public Page<T> page(S entity4s, Paging pi);

	public T merge(T entity);

	public T persist(T entity);

	public void remove(T entity);
	
	public void remove(Serializable id);

	public void flush();
}
